package com.databias.j15;


import java.awt.Color;
import java.awt.Font;
import java.awt.Graphics2D;


public class GText implements GObject {
	
	private String myText;
	private Font myFont =new Font ("Dialog", Font.PLAIN, 12); // default font

	public GText (String s)
	{
		myText=s;
	}
	
	public GText (String s, Font f)
	{
		this(s);  //chain
		setFont(f);
	}
	
	public void setText (String s)
	{
		myText=s;
	}
	
	public void setFont (Font f) {myFont=f;};
	
	public void draw(int x, int y, Graphics2D gs) {

		// Might need a bounding box to erase what was there first
		// design decision on if it should be done per item or at the collection level
		// right now- it'll be at the collection level
		//gs.drawRect(x, y, , height)

		
		gs.setColor(java.awt.Color.black);
		gs.setFont(myFont);
		gs.drawString(myText, x, y);

	}

}
